# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#

---
################################################################################
#
#   Profiles
#
#   - Different configuration profiles may be encoded here to be specified
#   as parameters to the configtxgen tool.  The profiles which specify consortiums
#   are to be used for generating the orderer genesis block.  With the correct
#   consortium members defined in the orderer genesis block, channel creation
#   requests may be generated with only the org member names and a consortium name
#
################################################################################
Profiles:

    # SampleInsecureSolo defines a configuration which uses the Solo orderer,
    # contains no MSP definitions, and allows all transactions and channel
    # creation requests for the consortium SampleConsortium.
    SampleInsecureSolo:
        Orderer:
            <<: *OrdererDefaults
        Consortiums:
            SampleConsortium:
                Organizations:

    # SampleNoConsortium is very similar to SampleInsecureSolo, except it
    # does not define Consortiums.
    SampleNoConsortium:
        Orderer:
            <<: *OrdererDefaults

    # SampleInsecureKafka defines a configuration that differs from the
    # SampleInsecureSolo one only in that is uses the Kafka-based orderer.
    SampleInsecureKafka:
        Orderer:
            <<: *OrdererDefaults
            OrdererType: kafka
        Consortiums:
            SampleConsortium:
                Organizations:

    # SampleDevModeSolo defines a configuration which uses the Solo orderer,
    # contains the sample MSP as both orderer and consortium member, and
    # requires only basic membership for admin privileges
    SampleDevModeSolo:
        Orderer:
            <<: *OrdererDefaults
            Organizations:
                - <<: *SampleOrg
                  AdminPrincipal: Role.MEMBER
        Consortiums:
            SampleConsortium:
                Organizations:
                    - <<: *SampleOrg
                      AdminPrincipal: Role.MEMBER

    # SampleSingleMSPSolo defines a configuration which uses the Solo orderer,
    # and contains a single MSP definition (the MSP sampleconfig).
    # The Consortium SampleConsortium has only a single member, SampleOrg
    SampleSingleMSPSolo:
        Orderer:
            <<: *OrdererDefaults
            Organizations:
                - *SampleOrg
        Consortiums:
            SampleConsortium:
                Organizations:
                    - *SampleOrg

    # SampleEmptyInsecureChannel defines a channel with no members
    # and therefore no access control
    SampleEmptyInsecureChannel:
        Consortium: SampleConsortium
        Application:
            Organizations:

    # SampleSingleMSPChannel defines a channel with only the sample org as a
    # member.  It is designed to be used in conjunction with SampleSingleMSPSolo
    # and SampleSingleMSPKafka orderer profiles
    SampleSingleMSPChannel:
        Consortium: SampleConsortium
        Application:
            Organizations:
                - *SampleOrg

################################################################################
#
#   Section: Organizations
#
#   - This section defines the different organizational identities which will
#   be referenced later in the configuration.
#
################################################################################
Organizations:

    # SampleOrg defines an MSP using the sampleconfig. It should never be used
    # in production but may be used as a template for other definitions.
    - &SampleOrg
        # DefaultOrg defines the organization which is used in the sampleconfig
        # of the fabric.git development environment.
        Name: SampleOrg

        # ID to load the MSP definition as.
        ID: DEFAULT

        # MSPDir is the filesystem path which contains the MSP configuration.
        MSPDir: msp

        # AdminPrincipal dictates the type of principal used for an
        # organization's Admins policy. Today, only the values of Role.ADMIN and
        # Role.MEMBER are accepted, which indicates a principal of role type
        # ADMIN and role type MEMBER respectively.
        AdminPrincipal: Role.ADMIN

        AnchorPeers:
            # AnchorPeers defines the location of peers which can be used for
            # cross-org gossip communication. Note, this value is only encoded
            # in the genesis block in the Application section context.
            - Host: 127.0.0.1
              Port: 7051

################################################################################
#
#   SECTION: Orderer
#
#   - This section defines the values to encode into a config transaction or
#   genesis block for orderer related parameters.
#
################################################################################
Orderer: &OrdererDefaults

    # Orderer Type: The orderer implementation to start.
    # Available types are "solo" and "kafka".
    OrdererType: solo

    Addresses:
        - 127.0.0.1:7050

    # Batch Timeout: The amount of time to wait before creating a batch.
    BatchTimeout: 2s

    # Batch Size: Controls the number of messages batched into a block.
    BatchSize:

        # Max Message Count: The maximum number of messages to permit in a
        # batch.
        MaxMessageCount: 10

        # Absolute Max Bytes: The absolute maximum number of bytes allowed for
        # the serialized messages in a batch. If the "kafka" OrdererType is
        # selected, set 'message.max.bytes' and 'replica.fetch.max.bytes' on the
        # Kafka brokers to a value that is larger than this one.
        AbsoluteMaxBytes: 10 MB

        # Preferred Max Bytes: The preferred maximum number of bytes allowed for
        # the serialized messages in a batch. A message larger than the
        # preferred max bytes will result in a batch larger than preferred max
        # bytes.
        PreferredMaxBytes: 512 KB

    # Max Channels is the maximum number of channels to allow on the ordering
    # network. When set to 0, this implies no maximum number of channels.
    MaxChannels: 0

    Kafka:
        # Brokers: A list of Kafka brokers to which the orderer connects.
        # NOTE: Use IP:port notation
        Brokers:
            - 127.0.0.1:9092

    # Organizations is the list of orgs which are defined as participants on
    # the orderer side of the network.
    Organizations:

################################################################################
#
#   SECTION: Application
#
#   - This section defines the values to encode into a config transaction or
#   genesis block for application related parameters.
#
################################################################################
Application: &ApplicationDefaults

    # Organizations is the list of orgs which are defined as participants on
    # the application side of the network.
    Organizations:
